package com.zhkj.txg.module.product.entity

import com.chad.library.adapter.base.entity.MultiItemEntity
import com.google.gson.annotations.SerializedName
import com.zhkj.lib.http.BaseResponse

data class ProductResponse(
    val data: ProductEntity
) : BaseResponse()

data class ProductEntity(
    val id: Int,
    @SerializedName("goods_name")
    val goodsName: String = "",
    @SerializedName("goods_content", alternate = ["content"])
    val goodsContent: String = "",
    @SerializedName("market_price")
    val marketPrice: String = "",
    val price: String = "",
    @SerializedName("sales_sum")
    val saleCount: Int = 0,
    @SerializedName("store_count", alternate = ["stock_num"])
    val storeCount: Int = 0,
    @SerializedName("active_type")
    val activeType: Int? = 0,
    @SerializedName("start_time")
    val startTime: Long = 0L,
    @SerializedName("end_time")
    val endTime: Long = 0L,
    val video: String = "",
    val image: String = "",
    val images: MutableList<String> = mutableListOf(),
    val rank: Int = 0,
    val spec: MutableList<SpecEntity> = mutableListOf(),
    @SerializedName("spec_goods_price")
    val specPrice: MutableList<SpecPriceEntity> = mutableListOf(),
    val comment: CommentEntity? = null,
    val shop: ShopEntity? = null,
    @SerializedName("is_collect")
    var isCollect: Boolean = false,
    @SerializedName("is_new")
    val isNew: String = "",
    @SerializedName("is_hot")
    val isHot: String = "",
    val service: MutableList<ServiceTagEntity> = mutableListOf(),
    val location: String = "",
    val share_earn: String = "",//赚
    val less: String = "",//省
    val people: String = "",//N人拼团
    var last_time: Long = 0,//倒计时
    val rule_brief: String = "",//玩法-简介
    val rule_detail: String = "",//玩法-详情
    val other_group: MutableList<Group> = mutableListOf(),//其他团信息
    val group_price: String? = "",//团购价
    @SerializedName("share_content")
    val shareContent: String = "",
    @SerializedName("share_images")
    val shareImages: MutableList<String> = mutableListOf(),
    @SerializedName("cat_id")
    val catId: Long = 0,
    @SerializedName("share_url")
    val shareUrl: String = "",
    @SerializedName("share_id")
    val shareId: Int = 0,
    @SerializedName("share_switch")
    val shareSwitch: Int? = null,
    val brand: BrandEntity? = null,
    val problem: MutableList<ProblemEntity> = mutableListOf()
)

data class ProblemEntity(
    val title: String? = null,
    val content: String? = null
)

data class Group(
    val id: String = "",
    val diff: String = "",
    val last_time: Long = 0,
    val nickname: String = "",
    val avatar: String = ""
)

data class SpecEntity(
    val name: String = "",
    @SerializedName("spec_value")
    val specValue: MutableList<SpecValueEntity> = mutableListOf()
)

data class SpecValueEntity(
    val id: Int,
    val value: String = "",
    var selected: Boolean = false
)

data class SpecPriceEntity(
    val id: Int,
    val key: String = "",
    @SerializedName("key_name")
    val keyName: String = "",
    @SerializedName("market_price")
    val marketPrice: String = "",
    val group_price: String = "",//团购价
    val price: String = "",
    @SerializedName("store_count", alternate = ["stock_num"])
    val storeCount: Int = 0,
    @SerializedName("spec_img")
    val specImage: String = "",
    @SerializedName("share_earn")
    val shareEarn: String? = null
)

data class CommentEntity(
    val content: String = "",
    val avatar: String = "",
    val nickname: String = ""
)

data class ShopEntity(
    val id: Int,
    @SerializedName("shop_name")
    val shopName: String = "",
    @SerializedName("shop_img")
    val shopImg: String = "",
    @SerializedName("businessicence_img")
    val licenceImg: String? = null,
    @SerializedName("shop_goods")
    val shopGoods: MutableList<ShopGoodsEntity> = mutableListOf()
)

data class ShopGoodsEntity(
    val id: Int,
    @SerializedName("goods_name")
    val goodsName: String = "",
    val image: String = "",
    @SerializedName("is_new")
    val isNew: String = "",
    @SerializedName("share_earn")
    val shareEarn: String = "",
    @SerializedName("market_price")
    val marketPrice: String = "",
    val price: String = ""
) : MultiItemEntity {
    override var itemType: Int = 0
    var shopName: String? = null
    var shopId: Long? = null
}

data class ServiceTagEntity(
    val title: String,
    val desc: String
)

data class BrandEntity(
    val name: String? = null,
    val image: String? = null
)